package com.jp.knowledge.fragment;

import android.view.View;
import android.widget.ImageView;

import com.jp.knowledge.R;
import com.jp.knowledge.model.PositionKnowlegeMode;

import java.util.List;

/**
 * Created by 528787067@qq.com on 2017/7/28.
 */

public class AdjustSortTypeFragment extends JobknowledgeFragment {
	@Override
	protected void init() {
		super.init();
		contentView.findViewById(R.id.sort_btn).setVisibility(View.GONE);
		titleName.setText("所属分类");
		searchBtn.setVisibility(View.GONE);
		ImageView leftIcon = (ImageView) contentView.findViewById(R.id.icon_left);
		leftIcon.setVisibility(View.VISIBLE);
		leftIcon.setImageResource(R.mipmap.arrow_white_left);
		leftIcon.setOnClickListener(this);
	}

	@Override
	protected JobKnowledgeDataFragment createFragment(PositionKnowlegeMode mode) {
		return AdjustSortTypeDetailFragment.newInstance(mode);
	}

	@Override
	protected void updateView(List<PositionKnowlegeMode> datas) {
		super.updateView(datas);
		searchBtn.setVisibility(View.GONE);
	}

	@Override
	public void onClick(View v) {
		if(v.getId() == R.id.icon_left)
			getActivity().onBackPressed();
		else
			super.onClick(v);
	}
}
